package com.h2cloud.T.type;

/**
 * @Package: com.h2cloud.T.type
 * @ClassName: Main
 * @Author: h2cloud
 * @CreateTime: 2023/11/3 12:15 上午
 * @Description:
 */
import java.lang.reflect.GenericDeclaration;
import java.lang.reflect.TypeVariable;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) {
		Class<?> clazz = MyClass2.class;
		TypeVariable<? extends Class<?>>[] typeParameters = clazz.getTypeParameters();
		Arrays.stream(typeParameters).forEach(typeVariable -> {
			System.out.println("Type Parameter Name: " + typeVariable.getName());
			System.out.println("Type Parameter Bounds: " + Arrays.toString(typeVariable.getBounds()));
		});
	}
}

class MyClass<T, U> {
	// Class implementation
}

class MyClass2<D extends GenericDeclaration> {
	// Class implementation
}

